import React, { useId } from "react";

export default function UseStateDemo() {

  const userId = useId();
  const nanId = useId();
  const nvId = useId();
  const id = useId();

  function testFn(){
    console.log("userId",userId);
  }
  
  return (
    <div>
      <h1>useId</h1>
      <input type="button" value="测试" onClick={testFn} />
      <input type="radio" id={id+"nv"}  />
      <label htmlFor={id+"nv"}>女</label>
      <input type="radio" id={id+"nan"} />
      <label htmlFor={id+"nan"}>男</label>
    </div>
  );
}